//
//  ShopcartSectionHeaderView.m
//  HAHAWENWAN
//
//  Created by 李小龙 on 2017/9/26.
//  Copyright © 2017年 ZDQK. All rights reserved.
//

#import "ShopcartSectionHeaderView.h"

@implementation ShopcartSectionHeaderView

- (instancetype)init {
    self = [super init];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    [self createView];
}

- (void)createView {
    self.view = [[[NSBundle mainBundle] loadNibNamed:@"ShopcartSectionHeaderView" owner:self options:nil] lastObject];
    self.view.frame = self.bounds;
    [self addSubview:self.view];
}
- (IBAction)selectButtonAction:(id)sender {
    UIButton *button = (UIButton *)sender;
    [button setSelected:!button.selected];
    if (self.block) {
        self.block(clickTypeSelect);
    }
}
- (IBAction)checkStoreButtonAction:(id)sender {
    if (self.block) {
        self.block(clickTypeCheckStore);
    }
}
- (IBAction)editButtonAction:(id)sender {
    UIButton *button = (UIButton *)sender;
    [button setSelected:!button.selected];
    if (self.block) {
        self.block(clickTypeEdit);
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
